<?php
/*
 * @Author: your name
 * @Date: 2020-05-21 16:37:54
 * @LastEditTime: 2020-05-22 15:40:51
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /v3/application/adminapiv3/controller/attackLogManage/fileLogManage/SystemEmpowermentController.php
 */ 

namespace app\adminapiv3\controller\attackLogManage\fileLogManage;

use app\adminapiv3\controller\Base;
use app\adminapiv3\service\attackLogManage\fileLogManage\SystemEmpowermentService;

/**
 * @name: 系统提权
 * @Param: 
 * @Description: 
 * @Author: foo
 * @Date: 2020-05-21 16:39:15
 */
class SystemEmpowermentController extends Base
{
    /**
     * @name: 列表
     * @Param: 
     * @Description: 
     * @Author: foo
     * @Date: 2020-05-22 14:02:35
     */
    function list ()
    {
        $input['attack_dest'] = $this->filterInput('attack_dest', 'get');//主机
        $input['type'] = $this->filterInput('type', 'get');//类型
        $input['atime'] = $this->filterInput('atime', 'get');//时间
        $input['path'] = $this->filterInput('path', 'get');//路径
        $input['handle'] = $this->filterInput('handle', 'get');//处理结果

        $input['limit'] = $this->filterInput('limit', 'get',10);

        $SystemEmpowermentService = new SystemEmpowermentService();
        $data = $SystemEmpowermentService->list($input);
        
        $this->jsonOutPut($data);
    }

    /**
     * @name 列表筛选数据
     * @author wx
     * @date 2020/5/25 15:01
     */
    function filterdata()
    {
        $type = $this->filterInput('type*', 'get', 'system_empowerment');
        $SystemEmpowermentService = new SystemEmpowermentService();

        $data = $SystemEmpowermentService->filterData($type);

        $this->jsonOutPut($data);
    }

    /**
     * @name: 批量删除
     * @Param: 
     * @Description: 
     * @Author: foo
     * @Date: 2020-05-22 10:54:26
     */
    function bulkDelete ()
    {
        global $logContent;
        $logContent = '批量删除系统提权日志';

        $id_s = $this->filterInput('id*', 'post');//删除id

        $SystemEmpowermentService = new SystemEmpowermentService();
        $SystemEmpowermentService->delete($id_s);

        $this->jsonOutPut();
    }

    /**
     * @name: 清空所有
     * @Param: 
     * @Description: 
     * @Author: foo
     * @Date: 2020-05-22 10:54:45
     */
    function clear ()
    {
        global $logContent;
        $logContent = '清空系统提权日志';

        $SystemEmpowermentService = new SystemEmpowermentService();
        $SystemEmpowermentService->clear();

        $this->jsonOutPut();
    }
}